package com.zj.service.impl;

import com.zj.api.DemoService;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;
@Service
public class DemoServiceImpl implements DemoService {
    Random random=new Random();
    @Override
    public String methodA() {
        return randomSleep();
    }

    @Override
    public String methodB() {
        return randomSleep();
    }

    @Override
    public String methodC() {
        return randomSleep();
    }
    public String randomSleep(){
        int i = random.nextInt(100);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "休眠毫秒："+i;
    }
}
